-
Notifications
You must be signed in to change notification settings - Fork 3
feat(Legend): add left and right options to legend.position config
#280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Legend): add left and right options to legend.position config
#280
Conversation
|
Preview is ready. |
|
Visual Tests Report is ready. |
left and right options to legend.position config left and right options to legend.position config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an additional field such as verticalAlign is suitable for vertical positioning of the legend (similar to horizontal align?: 'left' | 'center' | 'right';)
But this can (should) be done in a separate pr. For the legend to be positioned on the left/right, the current top-only positioning is enough - this is ok in my opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this can (should) be done in a separate pr.
OK, I will try to implement this in the next pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does there seem to be enough space from below? I would have expected to see more series in legend to take up all the available space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected to see more series in legend to take up all the available space
I'll take a look at it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| legend?.colorScale?.domain ?? getDomainForContinuousColorScale({series}); | ||
| } else { | ||
| height += lineHeight; | ||
| legendWidth = get(legend, 'width', DEFAULT_LEGEND_WIDTH); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it's a good idea to use the preset fixed value setting for the legend on the right/left. As a user, I would expect that the width will be calculated depending on the width of the legend elements - that is, the series name plus the symbol. But if the width is set explicitly, then OK, you can limit it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
@kuzmadom |
src/constants/defaults/legend.ts
Outdated
| width: 200, | ||
| }; | ||
|
|
||
| export const DEFAULT_LEGEND_WIDTH = 80; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it's not in use
f507195 to
63f5644
Compare
|
@kuzmadom |
I've fixed the legend's positioning and screenshots - hope everything should be fine now. But you need to pick up the latest version of the main branch |
ty, |
Yes, I think you should. Unfortunately, some of the snapshots were captured with existing bugs. Therefore, it happens that along with fixing a bug, you have to retake seemingly unrelated screenshots. This screenshot (in the main branch) shows that the legend ignored the specified chart margin - although it should take it into account (I think the screenshot in your branch shows the correct position). |
done |

No description provided.